package com.ash.test.autowire;

import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ash.autoawire.Person;



public class MySpringTestAutoWire {

	@Test
	public void test() {
		// 使用"spring.xml"和"spring-mybatis.xml"这两个配置文件创建Spring上下文
		ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext(new String[] {"beans-autowire.xml" });
		ac.registerShutdownHook();
		
//		Person p = (Person) ac.getBean("person");
//		System.out.println(p);
		
		Person p1 = (Person) ac.getBean("person1");
		System.out.println(p1);

	}

}
